<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0"/>
    <title th:text="${aqroom.getName()}"></title>
    <div th:include="head :: res"></div>
</head>
<body class="container">
<div th:include="head :: header-nav"></div>
<br>
<a class="btn btn-sm btn-primary" th:href="@{/question/add(id=${aqroom.getId()})}">提问</a>
<br>
<table class="table table-hover table-condensed">
    <thead>
    <tr>
        <th>标题</th>
        <th>提问者</th>
        <th>描述</th>
        <th>回答数</th>
        <th>时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="question : ${list}">
        <td><a th:text="${question.getTitle()}" th:href="@{/question/}+${question.id}"></a></td>
        <td th:text=" ${question.getCreateBy().getName()}">
        </td>
        <td th:text="${question.getDescribe()}"></td>
        <td th:text="${question.getAnswers().size()}"></td>
        <td th:text="${#dates.format(question.getCreateDate(), 'yyyy-MM-dd HH:mm:ss')}"></td>
        <td>
            <a class="btn btn-sm btn-info" th:href="@{/question/form/}+${question.id}">编辑</a>
            <a class="btn btn-sm btn-danger" th:href="@{/question/delete/}+${question.id}">删除</a>
        </td>
    </tr>
    </tbody>
</table>
</body>
</html>